<template>
  <div class="advertisingSpaceSetting">
    <div class="flex-all pt10 pb10 pl12 pr12 bg-white height50">
      <div class="ct-head-left flex-al">
        <span class="left-line-orange mr10"></span>
        <span class="color-333 fs14">
          收费项目设置
          <el-tooltip
            effect="dark"
            content="设置收费项目二级明细"
            placement="top"
          >
            <em class="el-icon-question cur-pointer"></em>
          </el-tooltip>
        </span>
      </div>
      <div class="cr-head-right flex-al">
        <el-tooltip
          effect="dark"
          content="设置收费项目一级分类"
          placement="top"
        >
          <em
            class="el-icon-question cur-pointer mr10"
          ></em>
        </el-tooltip>        <div
          class="flex-al fs16 color-333 mr20 cur-pointer"
          @click="handleTypeSet"
        >
          项目类型设置
          <em class="el-icon-s-tools ml5"></em>
        </div>
        <el-button type="primary" size="mini" @click="handAdd">{{
          $t("gradenSet.gradenSet.ReasonForTrial.50zgt2bmc3g0")
        }}</el-button>
      </div>
    </div>
    <div class="pAll12 bt_EBEEF5">
      <div class="flex-wrap">
        <div class="flex-al mb12">
          <div class="select-box" style="width: 170px">
            <el-select
              v-model="filter.feetype_id"
              clearable
              filterable
              placeholder="请选择项目类型"
              @change="search"
              @clear="search"
            >
              <el-option
                v-for="(item, index) in feeTypeList"
                :key="index"
                :label="item.feetype_name"
                :value="item.feetype_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="lines ml16 mr16 mb12"></div>
        <div class="flex-al mb12">
          <div class="select-box" style="width: 170px">
            <el-select
              v-model="filter.feeitem_class"
              clearable
              filterable
              placeholder="请选择收费模式"
              @change="search"
              @clear="search"
            >
              <el-option label="标准收费" value="0"></el-option>
              <el-option label="普通收费" value="1"></el-option>
            </el-select>
          </div>
        </div>
        <div class="lines ml16 mr16 mb12"></div>
        <div class="flex-al mb12">
          <div class="select-box" style="width: 170px">
            <el-select
              v-model="filter.feeitem_status"
              clearable
              filterable
              placeholder="请选择是否启用"
              @change="search"
              @clear="search"
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="0"></el-option>
            </el-select>
          </div>
        </div>
        <div class="lines ml16 mr16 mb12"></div>
        <div class="flex-al Inquire-box mb12">
          <div class="ipt-box" style="width: 250px">
            <el-input
              v-model="filter.keyword"
              clearable
              placeholder="可检索项目名称"
              @clear="search"
              @keyup.enter.native="search"
            ></el-input>
          </div>
          <el-button
            type="primary"
            size="mini"
            class="search-btn fs14"
            @click="search"
            >{{ $t("gradenSet.gradenSet.childChange.50zgdqy93kk0") }}</el-button
          >
        </div>
      </div>
      <div class="tableDiv" ref="auto_height_table">
        <switchTableCont
          :tableData="tableList"
          @switchChange="switchChange"
        >
          <!-- 按钮操作组********start -->
          <el-table-column
            ref="fixedColumn"
            :label="$t('gradenSet.gradenSet.ReasonForTrial.50zgt2bmd1w0')"
            align="center"
            width="120px"
            fixed="right"
          >
            <template slot-scope="scope">
              <el-button
                type="text"
                size="small"
                @click.native.prevent="handEdit(scope.row)"
                >{{
                  $t("gradenSet.gradenSet.ReasonForTrial.50zgt2bmde40")
                }}</el-button
              >
              <el-button
                type="text"
                size="small"
                @click.native.prevent="handDelete(scope.row, 'item')"
                >{{
                  $t("gradenSet.gradenSet.ReasonForTrial.50zgt2bmdpg0")
                }}</el-button
              >
            </template>
          </el-table-column>
          <!-- 按钮操作组********end -->
        </switchTableCont>
        <!-- 分页 -->
        <el-pagination
          style="margin: 10px"
          :current-page.sync="paging.curPage"
          :page-sizes="[10, 20, 30, 40]"
          :page-size.sync="paging.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="paging.pageTotal"
          @current-change="curPageChange"
          @size-change="pageSizeChange"
        ></el-pagination>
      </div>
    </div>

    <!-- 新增项目类型 -->
    <el-drawer
      title="新增项目类型"
      :visible.sync="addItemTypeVisible"
      direction="rtl"
      size="550px"
      :modal="false"
      custom-class="pop-slider--box"
      :before-close="handleClose"
    >
      <div class="slider-btn">
        <el-button type="primary" size="mini" @click="addFeetypeAction">{{
          $t("gradenSet.gradenSet.ReasonForTrial.50zgt2bme0g0")
        }}</el-button>
      </div>
      <div class="slider-content pAll20">
        <template v-for="(item, index) in addTypeList" >
          <div class="flex-al" :key="index">
            <div
              class="pt20 pr20 mb20 ml10"
              style="border: 1px solid #ddd; border-radius: 10px"
            >
              <el-form
                label-width="120px"
                :model="item"
                :rules="rules"
                :ref="`ruleForm${index}`"
              >
                <el-form-item label="项目类型" prop="feetype_name">
                  <el-input
                    clearable
                    placeholder="请输入项目类型"
                    v-model="item.feetype_name"
                    style="width: 320px"
                  ></el-input>
                </el-form-item>
                <el-form-item label="备注">
                  <el-input
                    type="input"
                    v-model="item.feetype_remk"
                    placeholder="请填写备注"
                    style="width: 320px"
                  >
                  </el-input>
                </el-form-item>
              </el-form>
            </div>
            <div
              style="margin-top: -20px"
              class="cur-pointer fs20 ml20"
              :class="{
                'el-icon-circle-plus': index == 0,
                'el-icon-remove': index > 0,
              }"
              @click="index == 0 ? addType() : reduceType(index)"
            ></div>
          </div>
        </template>
        <p class="color-red">
          * {{ $t("gradenSet.gradenSet.ReasonForTrial.50zgt2bmf9s0") }}
        </p>
      </div>
    </el-drawer>

    <!-- 删除 -->
    <popTips
      :dialogVisable="delItem"
      :popTipsCont="popTips_del"
      @handConfirm="handleDelete"
      @handCancel="delItem = false"
      @handleCloseTip="delItem = false"
    ></popTips>

    <!-- 项目类型设置 -->
    <el-drawer
      title="项目类型设置"
      :visible.sync="suitParkVisible"
      direction="rtl"
      size="550px"
      :modal="false"
      custom-class="pop-slider--box"
      :before-close="handleClose"
    >
      <div class="slider-btn">
        <el-button type="primary" size="mini" @click="addItemTypeVisible = true"
          >新增</el-button
        >
      </div>
      <div class="pt15 pl20 pr20 pb20">
        <div class="flex-wrap">
          <div class="flex-al Inquire-box mb12">
            <div class="ipt-box" style="width: 250px">
              <el-input
                v-model="keyword"
                clearable
                placeholder="可检索项目类型"
                @clear="keyword = '', filterGetFeetypeApi()"
                @keyup.enter.native="filterGetFeetypeApi()"
              ></el-input>
            </div>
            <el-button
              type="primary"
              size="mini"
              class="search-btn fs14"
              @click="filterGetFeetypeApi()"
              >{{
                $t("gradenSet.gradenSet.childChange.50zgdqy93kk0")
              }}</el-button
            >
          </div>
        </div>
        <div class="tableDiv" ref="fee_height_table">
          <normalTableCont
            :tableData="feeTypeData"
          >
            <!-- 按钮操作组********start -->
            <el-table-column
              ref="fixedColumn"
              :label="$t('gradenSet.gradenSet.ReasonForTrial.50zgt2bmd1w0')"
              align="center"
              width="120px"
              fixed="right"
            >
              <template slot-scope="scope">
                <el-button
                  type="text"
                  size="small"
                  @click.native.prevent="handEditItemType(scope.row)"
                  >{{
                    $t("gradenSet.gradenSet.ReasonForTrial.50zgt2bmde40")
                  }}</el-button
                >
                <el-button
                  type="text"
                  size="small"
                  @click.native.prevent="handDelete(scope.row, 'itemType')"
                  >{{
                    $t("gradenSet.gradenSet.ReasonForTrial.50zgt2bmdpg0")
                  }}</el-button
                >
              </template>
            </el-table-column>
            <!-- 按钮操作组********end -->
          </normalTableCont>
        </div>
      </div>
    </el-drawer>

    <!-- 新增项目 -->
    <el-drawer
      :title="popType =='add'?'新增项目':'编辑项目'"
      :visible.sync="addItemVisible"
      direction="rtl"
      size="550px"
      :modal="false"
      custom-class="pop-slider--box"
      :before-close="handleClose"
    >
      <div class="slider-btn">
        <el-button type="primary" size="mini" @click="addFeeitemAction">{{
          $t("gradenSet.gradenSet.ReasonForTrial.50zgt2bme0g0")
        }}</el-button>
      </div>
      <div class="slider-content pAll20">
        <el-form label-width="120px" ref="addItemFormRef" :model="addItemForm">
          <el-form-item
            label="项目类型"
            prop="feetype_id"
            :rules="[{ required: true, message: '请选择项目类型' }]"
          >
            <el-select
              style="width: 320px"
              v-model="addItemForm.feetype_id"
              placeholder="请选择项目类型"
            >
              <el-option
                v-for="(item, index) in feeTypeData.list"
                :key="index"
                :label="item.feetype_name"
                :value="item.feetype_id"
              ></el-option>
            </el-select>
            <div
              v-if="feeTypeData.list.length == 0"
              class="color-orange cur-pointer"
              @click="handleTypeSet"
            >
              暂未设置，立即设置 <em class="el-icon-caret-right"></em>
            </div>
          </el-form-item>

          <el-form-item
            label="项目名称"
            prop="feeitem_name"
            :rules="[{ required: true, message: '请输入项目名称' }]"
          >
            <el-input
              clearable
              placeholder="请输入项目名称"
              v-model="addItemForm.feeitem_name"
              style="width: 320px"
            ></el-input>
          </el-form-item>
          <el-form-item
            label="收费模式"
            prop="feeitem_class"
            :rules="[{ required: true, message: '请选择收费模式' }]"
          >
            <el-radio-group v-model="addItemForm.feeitem_class">
              <el-radio label="0">标准收费</el-radio>
              <el-radio label="1">普通收费</el-radio>
            </el-radio-group>
          </el-form-item>

          <template v-if="addItemForm.feeitem_class == 1">
            <el-form-item
              label="是否需集团审核"
              prop="feeitem_isaudit"
              :rules="[{ required: true, message: '请选择是否需集团审核' }]"
            >
              <el-radio-group v-model="addItemForm.feeitem_isaudit">
                <el-radio label="1">是</el-radio>
                <el-radio label="0">否</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item
              label="是否兴趣班收费"
              prop="feeitem_ishobby"
              :rules="[{ required: true, message: '请选择是否兴趣班收费' }]"
            >
              <el-radio-group v-model="addItemForm.feeitem_ishobby">
                <el-radio label="1">是</el-radio>
                <el-radio label="0">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </template>
          <el-form-item
            label="是否启用"
            prop="feeitem_status"
            :rules="[{ required: true, message: '请选择是否启用' }]"
          >
            <el-radio-group v-model="addItemForm.feeitem_status">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <p class="color-red">
          * {{ $t("gradenSet.gradenSet.ReasonForTrial.50zgt2bmf9s0") }}
        </p>
      </div>
    </el-drawer>

    <div class="small-dialog" v-if="editTypeVisible">
      <el-dialog
        title="编辑项目类型"
        :visible.sync="editTypeVisible"
        width="550px"
        :before-close="handleClose"
      >
        <div
          class="pt20 pr20 mb20 ml10"
          style="border: 1px solid #ddd; border-radius: 10px"
        >
          <el-form
            label-width="120px"
            :model="currentItemType"
            ref="currentItemTypeRef"
            :rules="rules"
          >
            <el-form-item label="项目类型" prop="feetype_name">
              <el-input
                clearable
                placeholder="请输入项目类型"
                v-model="currentItemType.feetype_name"
                style="width: 320px"
              ></el-input>
            </el-form-item>
            <el-form-item label="备注">
              <el-input
                type="input"
                v-model="currentItemType.feetype_remk"
                placeholder="请选择备注"
                style="width: 320px"
              >
              </el-input>
            </el-form-item>
          </el-form>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button type="primary" size="mini" @click="handleEditType"
            >确定</el-button
          >
          <el-button size="mini" @click="editTypeVisible = false"
            >取消</el-button
          >
        </span>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import switchTableCont from "@/components/tables/switchTableCont.vue";
import normalTableCont from "@/components/tables/normalTableCont.vue";
import popTips from "@/components/common/popTips/popTips.vue";
import setHttp from "../../Set";

export default {
  name: "setting",
  components: {
    switchTableCont,
    normalTableCont,
    popTips,
  },
  data() {
    return {
      keyword: '',
      popType: '',
      feeTypeList: [],

      // 收费类型
      feeTypeData: {
        // 表格的列
        columns: [],
        // 表格数据
        list: [],
        options: {
          errortip: "", //空页面提示内容
          mutiSelect: false, //是否显示多选
          issetting: false, //是否可以编辑列
          tableHeight: 0,
        },
      },

      addTypeList: [{ feetype_name: "", feetype_remk: "" }],
      editTypeVisible: false,

      // 新增项目
      addItemVisible: false,
      addItemForm: {
        feetype_id: "",
        feeitem_id: "",
        feeitem_name: "",
        feeitem_class: '0',
        feeitem_status: '1',
        feeitem_isaudit: '1',
        feeitem_ishobby: '1',
      },

      // 编辑项目类型
      currentItemType: {
        feetype_id: "",
        feetype_name: "",
        feetype_remk: "",
      },

      suitParkVisible: false,

      delItem: false,
      addItemTypeVisible: false,
      banner_id: "",
      currentAd: "",
      //删除学生取消柜询/试听原因****弹窗
      popTips_del: {
        btn_text1: this.$t("gradenSet.gradenSet.ReasonForTrial.50zgt2bmfjw0"),
        btn_text2: this.$t("gradenSet.gradenSet.ReasonForTrial.50zgt2bmfuk0"),
        title: "删除",
        context: "确定删除吗?",
      },

      // 检索
      filter: {
        feetype_id: "",
        feeitem_status: "",
        feeitem_class: "",
        keyword: "",
      },

      // 表格数据
      tableList: {
        // 表格的列
        columns: [],
        // 表格数据
        list: [],
        options: {
          errortip: "", //空页面提示内容
          mutiSelect: false, //是否显示多选
          issetting: false, //是否可以编辑列
          tableHeight: 0,
        },
      },

      // 分页
      paging: {
        curPage: 1,
        pageSize: 10,
        pageTotal: 0,
      },

      // 表单验证
      rules: {
        feetype_name: [
          {
            required: true,
            message: "请输入项目类型",
            trigger: ["change", "blur"],
          },
        ],
        feetype_remk: [
          {
            required: true,
            message: "请选择备注",
            trigger: ["change", "blur"],
          },
        ],
      },
    };
  },
  created() {
    this.getFeetypeApi();
    this.filterGetFeetypeApi();
    this.getFeeitemList();
  },
  watch: {
    addItemVisible (n) {
      if (!n) {
        this.addItemForm = {
          feetype_id: "",
          feeitem_id: "",
          feeitem_name: "",
          feeitem_class: '0',
          feeitem_status: '1',
          feeitem_isaudit: '1',
          feeitem_ishobby: '1',
        }
        this.$refs['addItemFormRef'].resetFields()
      }
    },
    suitParkVisible (n) {
      if (!n) {
        this.keyword = ''
      }
    },
    addItemTypeVisible (n) {
      if (!n) {
        this.addTypeList = [{ feetype_name: "", feetype_remk: "" }]
        this.$refs['ruleForm0'][0].resetFields()
      }
    }
  },
  methods: {
    // 新增收费项目类型
    async handAddFeetypeAction() {
      const res = await setHttp.addFeetypeAction({
        list: JSON.stringify(this.addTypeList),
      });
      const { error, errortip } = res.data;
      this.$message({
        type: error == 0 ? "success" : "error",
        message: errortip,
      });
      if (error == 0) {
        this.getFeetypeApi();
        this.filterGetFeetypeApi();
        this.addItemTypeVisible = false;
      }
    },
    addFeetypeAction() {
      this.addTypeList.forEach((item, index) => {
        this.$Tool.isNull1(`ruleForm${index}`, this);
      });
      if (
        this.addTypeList.every((item, index) => {
          return this.$Tool.isNull1(`ruleForm${index}`, this);
        })
      ) {
        this.handAddFeetypeAction();
      }
    },
    async getFeetypeApi() {
      const res = await setHttp.getFeetypeApi({});
      const { error, result } = res.data;
      if (error == 0) {
        this.feeTypeList = result.list;
      } else {
        this.feeTypeList = [];
      }
    },
    async filterGetFeetypeApi() {
      const res = await setHttp.getFeetypeApi({
        keyword: this.keyword
      });
      const { error, errortip, result } = res.data;
      this.feeTypeData.columns = result.field;
      if (error == 0) {
        this.feeTypeData.list = result.list;
      } else {
        this.feeTypeData.list = [];
      }
      this.feeTypeData.options.errortip = errortip;
    },

    // 新增项目
    async handAddFeeitemAction() {
      const res = await setHttp.addFeeitemAction({
        feeitem_name: this.addItemForm.feeitem_name,
        feeitem_status: this.addItemForm.feeitem_status,
        feeitem_class: this.addItemForm.feeitem_class,
        feeitem_isaudit: this.addItemForm.feeitem_class == 0 ? 0 : this.addItemForm.feeitem_isaudit,
        feeitem_ishobby: this.addItemForm.feeitem_class == 0 ? 0 : this.addItemForm.feeitem_ishobby,
        feetype_id: this.addItemForm.feetype_id,
      });
      const { error, errortip } = res.data;
      this.$message({
        type: error == 0 ? "success" : "error",
        message: errortip,
      });
      if (error == 0) {
        this.search();
        this.addItemVisible = false;
      }
    },
    addFeeitemAction() {
      this.$refs["addItemFormRef"].validate((v) => {
        if (v) {
          if (this.popType == 'add') {
            this.handAddFeeitemAction();
          } else {
            this.updateFeeitemAction()
          }
        } else {
          return;
        }
      });
    },
    async updateFeeitemAction () {
      const res = await setHttp.updateFeeitemAction({
        feeitem_name: this.addItemForm.feeitem_name,
        feeitem_status: this.addItemForm.feeitem_status,
        feeitem_class: this.addItemForm.feeitem_class,
        feeitem_isaudit: this.addItemForm.feeitem_class == 0 ? 0 : this.addItemForm.feeitem_isaudit,
        feeitem_ishobby: this.addItemForm.feeitem_class == 0 ? 0 : this.addItemForm.feeitem_ishobby,
        feeitem_id: this.addItemForm.feeitem_id,
        feetype_id: this.addItemForm.feetype_id,
      });
      const { error, errortip } = res.data;
      this.$message({
        type: error == 0 ? "success" : "error",
        message: errortip,
      });
      if (error == 0) {
        this.search();
        this.addItemVisible = false;
      } 
    },

    addType() {
      this.addTypeList.push({ feetype_name: "", feetype_remk: "" });
    },
    reduceType(i) {
      this.addTypeList.splice(i, 1);
    },
    handleTypeSet() {
      this.keyword = ''
      this.suitParkVisible = true;
      this.filterGetFeetypeApi()
      this.$nextTick(() => {
        if (this.$refs["fee_height_table"]) {
          this.feeTypeData.options.tableHeight = this.$Tool.getTableHeight(
            this.$refs.fee_height_table.getBoundingClientRect().top + 20
          );
        }
      });
    },
    switchChange(v1, v2) {
      console.log(v1, v2);
      this.updateFeeStatusAction(v1)
    },
    async updateFeeStatusAction (v) {
      const respon = await setHttp.updateFeeStatusAction({
        feeitem_status: v.feeitem_status == 100 ? 1: 0,
        feeitem_id: v.feeitem_id
      })
      const { error, errortip } = respon.data
      this.$message({
        type: error == 0 ? "success" : "error",
        message: errortip,
      });
      this.search();
    },
    //园务相关设置 列表
    getFeeitemList() {
      setHttp
        .getFeeitemList({
          is_count: 1, //是否需要总数，可以不传
          p: this.paging.curPage,
          num: this.paging.pageSize,
          feetype_id: this.filter.feetype_id,
          feeitem_status: this.filter.feeitem_status,
          feeitem_class: this.filter.feeitem_class,
          keyword: this.filter.keyword,
        })
        .then((res) => {
          this.paging.pageTotal = parseInt(res.data.result.allnum);
          this.tableList.columns = res.data.result.field;
          if (res.data.error == 0) {
            this.tableList.list = res.data.result.list;
          } else {
            this.tableList.list = [];
            this.tableList.options.errortip = res.data.errortip;
          }
        });
    },
    //检索
    search() {
      this.paging.curPage = 1;
      this.getFeeitemList();
    },
    //新增
    handAdd() {
      this.popType = 'add'
      this.addItemVisible = !this.addItemVisible;
    },

    handEditItemType(v) {
      console.log(v);
      const { feetype_id, feetype_name, feetype_remk } = v;
      this.currentItemType.feetype_id = feetype_id;
      this.currentItemType.feetype_name = feetype_name;
      this.currentItemType.feetype_remk = feetype_remk;
      this.editTypeVisible = !this.editTypeVisible;
    },
    handleEditType() {
      this.$refs["currentItemTypeRef"].validate((v) => {
        if (v) {
          this.updateFeetypeAction();
        } else {
          return;
        }
      });
    },
    async updateFeetypeAction() {
      const res = await setHttp.updateFeetypeAction({
        feetype_name: this.currentItemType.feetype_name,
        feetype_remk: this.currentItemType.feetype_remk,
        feetype_id: this.currentItemType.feetype_id,
      });
      const { error, errortip } = res.data;
      this.$message({
        type: error == 0 ? "success" : "error",
        message: errortip,
      });
      if (error == 0) {
        this.getFeetypeApi();
        this.filterGetFeetypeApi();
        this.editTypeVisible = false;
      }
    },
    //编辑
    handEdit(v) {
      this.popType = 'edit'
      const {
        feetype_id,
        feeitem_id,
        feeitem_name,
        feeitem_class,
        feeitem_status,
        feeitem_isaudit,
        feeitem_ishobby,
      } = v;
      this.addItemForm.feetype_id = feetype_id;
      this.addItemForm.feeitem_id = feeitem_id;
      this.addItemForm.feeitem_name = feeitem_name;
      this.addItemForm.feeitem_class = feeitem_class;
      this.addItemForm.feeitem_status = feeitem_status == 100?'1':'0'
      this.addItemForm.feeitem_isaudit = feeitem_isaudit;
      this.addItemForm.feeitem_ishobby = feeitem_ishobby;
      this.addItemVisible = !this.addItemVisible;
    },
    //删除
    handDelete(v, type) {
      this.delType = type;
      if (type == "item") {
        // 收费项目删除
        this.delId = v.feeitem_id;
      } else if (type == "itemType") {
        // 收费项目类型删除
        this.delId = v.feetype_id;
      }
      this.delItem = !this.delItem;
    },
    handleDelete() {
      if (this.delType == "item") {
        // 收费项目删除
        this.delFeeitemAction();
      } else if (this.delType == "itemType") {
        // 收费项目类型删除
        this.delFeetypeAction();
      }
    },
    async delFeetypeAction() {
      const res = await setHttp.delFeetypeAction({
        feetype_id: this.delId,
      });
      const { error, errortip } = res.data;
      this.$message({
        type: error == 0 ? "success" : "error",
        message: errortip,
      });
      if (error == 0) {
        this.getFeetypeApi();
        this.filterGetFeetypeApi();
        this.delItem = false;
      }
    },
    async delFeeitemAction() {
      const res = await setHttp.delFeeitemAction({
        feeitem_id: this.delId,
      });
      const { error, errortip } = res.data;
      this.$message({
        type: error == 0 ? "success" : "error",
        message: errortip,
      });
      if (error == 0) {
        this.search();
        this.delItem = false;
      }
    },

    // 页码变化
    curPageChange(v) {
      this.paging.curPage = v;
      this.getFeeitemList();
    },
    // pageSize改变
    pageSizeChange() {
      this.paging.curPage = 1;
      this.getFeeitemList();
    },
    //侧边弹窗-关闭
    handleClose(done) {
      done();
    },
  },
  mounted() {
    this.$nextTick(() => {
      if (this.$refs["auto_height_table"]) {
        this.tableList.options.tableHeight = this.$Tool.getTableHeight(
          this.$refs.auto_height_table.getBoundingClientRect().top + 55
        );
      }
    });
  },
};
</script>

<style lang="less" scoped>
/deep/.el-upload-dragger {
  width: 320px !important;
}
.advertisingSpaceSetting {
}
</style>
